package twoD.IsoPfem.EmbeddedCrackModel;

public class LinearTractionSeparationLaw implements ITractionSeparationLaw {

	private double ef_;
	private double ft_;

	public LinearTractionSeparationLaw(double ef, double ft) {
		ef_ = ef;
		ft_ = ft;
	}

	@Override
	public double g(double en) {
		double tmp = 0;
		if (en <= ef_)
			tmp = ft_ * (1 - en / ef_);
		return tmp;
	}

	@Override
	public double dg(double en) {
		double tmp = 0;
		if (en <= ef_)
			tmp = -ft_ / ef_;
		return tmp;
	}

	@Override
	public double getTensileStrength() {
		return ft_;
	}

	@Override
	public double getEf() {
		return ef_;
	}

}
